<script setup>
  import {ref, reactive} from 'vue'
  let parentMessage = ref('产品')
  let items = reactive([
    {
      id:'item1',
      message:'薯片'
    },
    {
      id:'item2',
      message:'可乐'
    }
  ])
</script>

<template>
  <div>
    <ul>
      <li v-for = 'item in items' v-bind:key = 'item.id'>
        {{item.message}}
      </li>
    </ul>
    <ul>
      <!-- index 表示索引 -->
      <li v-for = "(item, index) in items" v-bind:key="index">
        {{parentMessage}} - {{index}} - {{item.message}}
      </li>
    </ul>
  </div>
</template>

<style scoped>

</style>
